//跳转
import {mapState,mapActions} from 'vuex'
import {objectToParams} from '@/util/function'

const CommunityMixin = {
    computed:{
        ...mapState("community",["communityId"]),
    },
    methods: {
      ...mapActions("community",["checkLoginAndBoundHouses"]),
      async handleVote(item,type) {
        let res=await this.checkLoginAndBoundHouses()
        if(!res) return
        let params=objectToParams({
          voteId:item.voteId,
          communityId:this.communityId,
          wxUserId:this.user.wxUser.wxUserId,
          type:this.type
        })
      if(type==2){
         uni.navigateTo({
          url: `/pages/quickresolution/index?${params}`
        })
      }else  if(type==3){
        uni.navigateTo({
          url: `/pages/questionnaire/index?${params}`
        })
      }else if(type==4){
        uni.navigateTo({
          url: `/pages/initiative/index?${params}`
        })
      }else{
    
        uni.navigateTo({
          url: `/pages/votingForm/index?${params}`
        })
   
      }
      },
      
     
      
    }
  };
  
  export default CommunityMixin;